package com.start.shop.api.vo.order;

import java.math.BigDecimal;

import com.start.shop.modules.repository.entity.Goods;
import com.start.shop.modules.repository.entity.GoodsType;
import com.start.shop.modules.repository.entity.Sku;

import lombok.Data;

@Data
public class OrderInfoVo {
	private String goodsType;
	private BigDecimal price;
	private int num;
	private String sku;
	private BigDecimal totalPrice;

	public static OrderInfoVo setData(Sku sku,Goods goods, GoodsType goodsType, int num) {
		OrderInfoVo  orderInfoVo = new  OrderInfoVo();
		
		orderInfoVo.setGoodsType(goodsType.getTypeName());
		orderInfoVo.setPrice(sku.getSkuPrice());
		orderInfoVo.setTotalPrice(sku.getSkuPrice().multiply(new BigDecimal(num)));
		orderInfoVo.setNum(num);
		orderInfoVo.setSku(sku.skuName);
		
		return orderInfoVo;
	}
}
